/*    */ package com.wzh.action.control.config;
/*    */ 
/*    */ import com.opensymphony.xwork2.ActionContext;
/*    */ import com.opensymphony.xwork2.ActionSupport;
/*    */ import com.wzh.action.cache.CacheManager;
/*    */ import com.wzh.bean.config.SiteConfigInfo;
/*    */ import com.wzh.utils.PropertiesUtil;
/*    */ import java.util.Map;
/*    */ import org.springframework.stereotype.Controller;
/*    */ 
/*    */ @Controller
/*    */ public class SiteConfigAction extends ActionSupport
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/* 22 */   private PropertiesUtil properUtil = new PropertiesUtil("config.properties");
/*    */   private SiteConfigInfo siteConfigInfo;
/*    */ 
/*    */   public SiteConfigInfo getSiteConfigInfo()
/*    */   {
/* 28 */     return this.siteConfigInfo;
/*    */   }
/*    */ 
/*    */   public void setSiteConfigInfo(SiteConfigInfo siteConfigInfo)
/*    */   {
/* 35 */     this.siteConfigInfo = siteConfigInfo;
/*    */   }
/*    */ 
/*    */   public String index()
/*    */   {
/* 40 */     Map map = this.properUtil.getAllProperties();
/*    */ 
/* 42 */     this.siteConfigInfo = new SiteConfigInfo();
/* 43 */     this.siteConfigInfo.setProperties(map);
/* 44 */     return "edit";
/*    */   }
/*    */ 
/*    */   public String update() {
/* 48 */     Map map = this.siteConfigInfo.generateMap();
/* 49 */     this.properUtil.setProperties(map);
/*    */ 
/* 52 */     CacheManager.getInstance(null).flushAll();
/* 53 */     ActionContext.getContext().put("message", "网站配置成功,更新缓存成功");
/* 54 */     ActionContext.getContext().put("urladdress", "/control/systemconfig/site/index");
/* 55 */     return "message";
/*    */   }
/*    */ }

/* Location:           C:\work\apache-tomcat-7.0.55\webapps\ROOT\WEB-INF\classes\
 * Qualified Name:     com.wzh.action.control.config.SiteConfigAction
 * JD-Core Version:    0.6.1
 */